package org.fastng.xml {
	
	import mx.collections.ArrayCollection;
	
	/**
	 * An abstract implementation of a FastNG XML <suite> node.
	 */
	public class XmlSuite {	
		
		private var _tests:ArrayCollection;
		private var _parameters:ArrayCollection;
		
		/**
		 * The name of the suite.
		 */
		public var name:String;
		
		/**
		 * The constructor initializes a holder for multiple tests.
		 */
		public function XmlSuite():void {
			_tests = new ArrayCollection();
			_parameters = new ArrayCollection();
		}
		
		/**
		 * Adds a test to the suite.
		 * 
		 * @param test An instance of XmlTest.
		 */
		public function addTest(test:XmlTest):void {
			_tests.addItem(test);
		}
		
		/**
		 * Adds a parameter to the suite.
		 * 
		 * @param name An instance of String.
		 * @param value An instance of String.
		 */
		public function addParam(name:String, value:String):void {
			var param:XmlParameter = new XmlParameter(name, value);
			_parameters.addItem(param);
		}
		
		/**
		 * Returns all parameters in the suite.
		 * 
		 * @return An instance of ArrayCollection.
		 */
		public function get parameters():ArrayCollection {
			return _parameters;
		}
		
		/**
		 * Returns all tests in the suite.
		 * 
		 * @return An instance of ArrayCollection.
		 */
		public function get tests():ArrayCollection {
			return _tests;
		}

	}
}